﻿using System;

namespace CS
{
    /// <summary>
    /// 进度事件
    /// </summary>
    public class ProgressEventArgs : EventArgs
    {

        public ProgressEventArgs(double total, double value)
        {
            Total = total;
            Value = value;
        }

        /// <summary>
        /// 进度百分比
        /// </summary>
        public int Percent
        {
            get
            {
                if ((int)Total == 0)
                    return 0;
                return (int)(Value*100 / Total);
            }
        }

        /// <summary>
        /// 当前进度值
        /// </summary>
        public double Value { get; private set; }

        /// <summary>
        /// 总量
        /// </summary>
        public double Total { get; private set; }

    }
}